Include a header file required for build on mac 10.4
[supercollider.git] / Help / Extending and Customizing SC / Style Guide / Documentation Style Guide.html
blob0c17d758345a2ed330340d6ae7524c713d4bc112
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta http-equiv="Content-Style-Type" content="text/css">
6 <title></title>
7 <meta name="Generator" content="Cocoa HTML Writer">
8 <meta name="CocoaVersion" content="1038.25">
9 <style type="text/css">
10 p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Helvetica}
11 p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
12 p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; color: #0000ee}
13 p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Helvetica}
14 p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
15 p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
16 span.s1 {color: #000000}
17 span.s2 {text-decoration: underline}
18 span.s3 {text-decoration: underline ; color: #001ee6}
19 span.s4 {color: #0018b8}
20 span.s5 {text-decoration: underline ; color: #0000ee}
21 span.s6 {font: 12.0px Helvetica}
22 span.s7 {color: #0000ff}
23 span.s8 {text-decoration: underline ; color: #0018b8}
24 span.Apple-tab-span {white-space:pre}
25 </style>
26 </head>
27 <body>
28 <p class="p1"><b>Style Guide for SuperCollider Documentation</b></p>
29 <p class="p2"><br></p>
30 <p class="p3"><span class="s1"><b>See also: </b><a href="../Helper/Helper.html"><span class="s2">Helper</span></a> <a href="../Helper/AutoClassHelper.html"><span class="s2">AutoClassHelper</span></a> <a href="UGenHelpTemplate.html"><span class="s3">UGenHelpTemplate</span></a> <a href="ClassHelpTemplate.html"><span class="s3">ClassHelpTemplate</span></a></span><span class="s4"> <a href="TopicHelpTemplate.html"><span class="s5">TopicHelpTemplate</span></a></span></p>
31 <p class="p2"><br></p>
32 <p class="p4"><b>What this Guide Covers</b></p>
33 <p class="p2"><br></p>
34 <p class="p5">This document is intended as a style guide for SuperCollider documentation. SuperCollider's documentation must meet more varied requirements than some general purpose languages, as it needs to address a range of users from computer scientists to computer novices. It contains quick reference files, topics tutorials, and everything in between. As such, it should be understood that there will be numerous necessary exceptions to these guidelines, and that the intent of this guide is to assist in achieving consistency, clarity, and completeness.</p>
35 <p class="p2"><br></p>
36 <p class="p5">This document is not specifically intended to cover large-scale tutorials or third party libraries, although it is expected that authors may find these guidelines useful and appropriate in those contexts as well.</p>
37 <p class="p2"><br></p>
38 <p class="p4"><b>General Points</b></p>
39 <p class="p2"><br></p>
40 <p class="p5">Documentation should be complete. That is to say, all non-'private' methods of classes should be documented. Default values for arguments should be given, as should the type of any value returned. In general methods should only be documented in the help file for the class in which they are implemented, but on occasion it may be appropriate to document some inherited methods in help files for subclasses as well, for the sake of clarity.</p>
41 <p class="p2"><br></p>
42 <p class="p5">HTML is the preferred file format for documentation, and these guidelines are written mostly with html in mind. That said, much of what is contained here could apply to documentation in rtf, rtfd, or scd (plain text) formats as well.</p>
43 <p class="p2"><br></p>
44 <p class="p5">Use of the automatic help file generating faciliies of <a href="../Helper/Helper.html"><span class="s4">Helper</span></a> and <a href="../Helper/AutoClassHelper.html"><span class="s4">AutoClassHelper</span></a> is encouraged. In addition to making it easier to create helpfiles these help ensure consistency, completeness and uniformity.</p>
45 <p class="p2"><br></p>
46 <p class="p5">HTML should be basic. On OSX it can be generated automatically and is WYSIWYG editable. (See <a href="../Notes-on-the-HTML-Help-System.html"><span class="s4">Notes-on-the-HTML-Help-System</span></a> for details.) The use of hand-coded or overly complex HTML should be avoided wherever possible since it may not be parsed correctly on all platforms. HTML documents should not load non-local resources and should always function correctly in an offline context.</p>
47 <p class="p2"><br></p>
48 <p class="p5">Authors should aim to strike an appropriate balance between specialist discussion and accessibility to new users. Jargon should be used where it enhances clarity, but not where it is unnecessary. Naturally the particular level at which a given document is written will be context dependant.</p>
49 <p class="p2"><br></p>
50 <p class="p5">Links should be hyperlinks rather than the old style help links.</p>
51 <p class="p2"><br></p>
52 <p class="p5">Underlining should be avoided, as it is used for the built-in wiki system and can result in unintentional document creation by users.</p>
53 <p class="p2"><br></p>
54 <p class="p5">The use of margins (on OSX use Format-&gt;Text-&gt;Show Ruler, Copy Ruler, etc.) is preferrable to tabs when indenting chunks of prose (i.e. method explanations), as it maintains proper text wrap when edited. Tabs are fine for example code and should be utilised to indicate scope.</p>
55 <p class="p2"><br></p>
56 <p class="p5">The use of 'see also' links is encouraged.</p>
57 <p class="p2"><br></p>
58 <p class="p5">Authors are encouraged to keep these guidelines in mind when updating old help files, and correct any issues or inconsistencies.</p>
59 <p class="p2"><br></p>
60 <p class="p4"><b>Font Recommendations</b></p>
61 <p class="p2"><br></p>
62 <p class="p1"><span class="s6">Document Titles: </span><b>Helvetica 18 point Bold</b></p>
63 <p class="p5">Document Description (on the same line as the title): <b>Helvetica 12 point Bold</b></p>
64 <p class="p4"><span class="s6">Section Titles: </span><b>Helvetica 14 point Bold</b></p>
65 <p class="p5">Prose: Helvetica 12 point</p>
66 <p class="p5">Emphasized Text (inluding method and argument names, bullet headings, etc.): <b>Helvetica 12 point Bold</b></p>
67 <p class="p6"><span class="s6">Code examples: </span><span class="s4">Monaco</span> 9 point, syntax colorised</p>
68 <p class="p2"><br></p>
69 <p class="p4"><b>Code Examples</b></p>
70 <p class="p2"><br></p>
71 <p class="p5">Examples should make use of object style rather than messaging style unless the document in question relates specifically to the latter.</p>
72 <p class="p2"><br></p>
73 <p class="p5">Examples should use SynthDef:add rather than SynthDef:load or :store, or :memStore<span class="Apple-converted-space">  </span>wherever appropriate to avoid creating scsyndef files on the user's hard-drive (this recommendation has changed).</p>
74 <p class="p2"><br></p>
75 <p class="p5">Examples can use a mixture of Function:play and SynthDef style approaches where appropriate.</p>
76 <p class="p2"><br></p>
77 <p class="p5">Examples in object style should pass server abstraction objects such as Nodes, Buffers, and Busses as args directly rather than using the nodeID, bufnum, and index methods wherever possible.</p>
78 <p class="p2"><br></p>
79 <p class="p5">Examples can be placed in an examples section at the end of the text or interspersed within the text. The former is often appropriate for short documents (such as UGen help files) and the latter for longer documents. In some cases it may be appropriate to do both; for instance a large class with short examples demonstrating individual methods within the text and a longer examples section at the end. Interspersed examples should be indented.</p>
80 <p class="p2"><br></p>
81 <p class="p5">The initial examples in any help file should be as simple and clear as possible.</p>
82 <p class="p2"><br></p>
83 <p class="p5">Examples in the general SC documentation should not be dependant on any third party libraries, Quarks, etc. in order to function.</p>
84 <p class="p2"><br></p>
85 <p class="p5">Examples should include any necessary cleanup code. This includes explicitly freeing any created synths. Examples should not rely on an implicit use of Cmd-.</p>
86 <p class="p2"><br></p>
87 <p class="p5">Examples should wrap blocks of code that are meant to be executed together in parentheses. Individual examples should be distinguished by comments.</p>
88 <p class="p2"><br></p>
89 <p class="p5">Examples should make appropriate use of comments to explain what is happening.</p>
90 <p class="p2"><br></p>
91 <p class="p5">GUI examples should make use of the view redirect classes wherever possible in order to ensure cross-platform compatibility. See <a href="../../GUI/GUI-Overview.html"><span class="s4">GUI-Overview</span></a> for more information.</p>
92 <p class="p2"><br></p>
93 <p class="p5">Classes which are effectively front ends for OSC functionality (i.e. the server abstraction classes) should contain a section showing the OSC messages generated by the class. This can for instance take the form of an example using Server:makeBundle.</p>
94 <p class="p2"><br></p>
95 <p class="p5">Examples which make reference to keyboard shortcuts should include all cross-platform equivalents. See <a href="../../Other Topics/Shortcuts.html"><span class="s7">Shortcuts</span></a> for documentation of these.</p>
96 <p class="p2"><br></p>
97 <p class="p5">The use of plot and scope in examples is encouraged where appropriate (i.e. to illustrate something particular about a UGen), but such examples should not be the only ones in any file as they have GUI dependencies. Alternatively, plots can be included as images. Scope examples should call Stethoscope.defaultServer to get the appropriate server object.</p>
98 <p class="p2"><br></p>
99 <p class="p4"><b>Layout</b></p>
100 <p class="p2"><br></p>
101 <p class="p5">Documents should be in one three styles, broadly speaking (although the use of custom document styles may sometimes be necessary):</p>
102 <p class="p2"><br></p>
103 <p class="p5"><b>UGen Help File</b> - A short file outlining *ar, *kr, and *ir methods as appropriate. Should include examples. <b>mul</b> and <b>add</b> arguments are generally not documented due to their ubiquity.</p>
104 <p class="p2"><br></p>
105 <p class="p5"><b>Class Help File</b> - Usually a longer file documenting a particular class. In general methods will be divided up into sections by type and related functionality, rather than simply listed alphabetically. For smaller classes they might simply be divided into Class Methods and Instance Methods. Detailed general explanations can be done at the top of the document or at the top of each relevant section. It is often appropriate to document getters and setters or other closely related methods together. These documents should still be suitable for quick reference, so if extensive prose explanation is necessary it may be appropriate to move that text to a 'Topic' file and link to it.</p>
106 <p class="p2"><br></p>
107 <p class="p5"><b>Topic File</b> - These are longer, mostly prose documents which serve as short tutorials explaining some aspect of SC's use or design, relevant theory, etc. These are less than full-fledged general tutorials but probably still useful for some reference. As a general rule particular care should be taken in this type of document to ensure that they are accessible to users with less experience.</p>
108 <p class="p2"><br></p>
109 <p class="p5">Authors will probably find it simplest to use <a href="../Helper/Helper.html"><span class="s4">Helper</span></a> and <a href="../Helper/AutoClassHelper.html"><span class="s4">AutoClassHelper</span></a> when creating help files, but the following templates are available for use: <a href="UGenHelpTemplate.html"><span class="s8">UGenHelpTemplate</span></a> <a href="ClassHelpTemplate.html"><span class="s8">ClassHelpTemplate</span></a><span class="s4"> <a href="TopicHelpTemplate.html"><span class="s5">TopicHelpTemplate</span></a></span></p>
110 <p class="p2"><span class="Apple-tab-span"> </span></p>
111 <p class="p5"><b>v. 1.3 April 2009</b></p>
112 </body>
113 </html>